In a messaging system each messaging queue is typically associated with a destination. The messaging system receives messages from a number of other systems. Each message relates to a particular destination. As the messages are received by the messaging system, a message listener assigned to a queue listens for a relevant message which is destined for its queue and stores each of the messages on its queue. As a message is stored on a message queue the message listener alerts its associated messaging client, who has subscribed to receive messages from the message listener's queue that a message has arrived. Control is then passed to the messaging client so that the messaging client can continue processing the message.
A problem arises when a messaging client is written using an asynchronous message delivery model. This is because the messaging client is connected to the messaging server via an API binding, meaning messages are passed directly to the client from the server, rather than through a set of network codes and/or onto a queue local to the messaging client. Examples of types of asynchronous messaging systems are, but not limited to, point-to-point and publish subscribe messaging systems.
In an asynchronous messaging system it is not always possible to determine when there are no further messages for the messaging client on the messaging system. This is because there is no socket connection on which to timeout and no local queue to query. Thus the message listener component on the messaging client is permanently active waiting for further messages to be delivered from the messaging system.
A client messaging application may receive batches of messages which will be processed in quick succession. When there are no further messages left on the queue it may mean that there is no further work to be done on that particular queue. This situation is not adequately addressed in the known prior art systems.
Thus it would be desirable to alleviate the above problems.